package com.sina.shop.util;

import java.nio.charset.Charset;
import java.time.LocalDateTime;
import java.time.ZoneId;
import java.time.format.DateTimeFormatter;

/**
 * <p>
 * </p>
 *
 * @version 1.0
 */
public interface Constant {

    String UTF8 = "UTF-8";

    String GB2312 = "GB2312";

    String GBK = "GBK";

    Charset CHARSET_UTF8 = Charset.forName(UTF8);


    String dateTimeFormat = "yyyy-MM-dd HH:mm:ssZ";

    //DateTimeFormatter dateTimeWithZoneFormatter = DateTimeFormatter.ofPattern("uuuu-MM-dd HH:mm:ssZ");

    /**
     * 由于指定东八区,只可用于序列化 ,不可用于反序列化
     */
    //DateTimeFormatter dateTimeZone8Formatter = dateTimeWithZoneFormatter.withZone(ZoneId.of("+08:00"));

    DateTimeFormatter DATETIME_FORMATTER = DateTimeFormatter.ofPattern("uuuu-MM-dd HH:mm:ss");

    DateTimeFormatter DATE_FORMATTER = DateTimeFormatter.ofPattern("uuuu-MM-dd");

    String timeZone8 = "GMT+08:00";

    /**
     * 注意! 这个值并非真正意义上的零值,只是为了解决 DBA 要求 表合 not null 与 实践的矛盾
     */
    LocalDateTime ZERO_DATE_TIME = LocalDateTime.of(0, 1, 1, 0, 0, 0, 0);

    ZoneId ZONEID8 = ZoneId.of(timeZone8);


}
